﻿using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using FX.CC.Andon.Entity.BasicDataManage;
using FX.CC.Andon.Service.BasicDataManage;
using FX.CC.Andon.Utility.Json;

namespace FX.CC.Andon.Business.BasicDataManage
{
    public class EventRecBusiness
    {
        private readonly EventRecService _dal = new EventRecService();

        public string GetEventRecInfo(string id)
        {
            return JsonHelper.Encode(_dal.GetEventRecInfo(id));
        }

        public bool ModifyEventRec(string data)
        {
            var model = new EventRecEntity();
            var rows = (ArrayList)JsonHelper.Decode(data);
            foreach (Hashtable row in rows)
            {
                model.EventID = new Guid(row["EventID"].ToString());
                model.Remark = row["Remark"] != null ? row["Remark"].ToString() : "";
            }
            return _dal.ModifyEventRec(model);
        }
    }
}
